package org.jeecg.enums.car;

/**
 * 市停车平台 - url类型
 *
 */
public enum CarShParkingUrlEnum {
    CAR_SH_PARKING_URL_1(1, "临停费用查询接口路径"),
    CAR_SH_PARKING_URL_2(2, "支付成功通知路径"),
    CAR_SH_PARKING_URL_3(3, "发票开具请求路径"),
    CAR_SH_PARKING_URL_4(4, "场内寻车接口路径"),
    ;
    private Integer code;
    private String desc;

    CarShParkingUrlEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(Integer value) {
        if (value == null) return "";
        CarShParkingUrlEnum[] enums = values();
        for (CarShParkingUrlEnum typeEnum : enums) {
            if (value.intValue()  == typeEnum.getCode().intValue()) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static Integer getValue(String desc) {
        CarShParkingUrlEnum[] enums = values();
        for (CarShParkingUrlEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }

}
